<!doctype html>
<html lang="en">
 <head>
  <meta charset="UTF-8">
  <meta name="Generator" content="EditPlus®">
  <meta name="Author" content="">
  <meta name="Keywords" content="">
  <meta name="Description" content="">
  <title>Document</title>
 </head>
 <body>
  <button id="open">打开窗口</button>
  <button id="close">关闭窗口</button>
 </body>
 <script>
    var $ = function(obj){
	   return document.getElementById(obj);
	}
	window.onload = function(){
	 var open = $("open");
	 var close = $("close");
	 var myclose;
     //打开一个窗口
	 open.onclick = function(){
	   myclose = window.open("http://www.zhiliaotang.com","_blank","toolbar=yes,loaction=yes,width=500,height=500,resizeable=no");
	 }
	 close.onclick = function(){
	    myclose.close();
	 }
	}
 </script>
</html>
